package top.stacktrace.order.config.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import top.stacktrace.order.service.OrderService;
import top.stacktrace.util.Result;

@RestController
public class OrderController {
    @Autowired
    private OrderService orderService;

    @PostMapping("/order")
    public Result order(@RequestHeader long userid, @RequestParam long bookid){
        return Result.ok(orderService.order(userid,bookid));
    }
}
